<template>
  <div class="extra-success" v-if="showType==='extra'">
    <span class="xz-confirm-title">
      <svg-icon :iconClass="appCfg.logo"/>
      {{appCfg.name}}
    </span>
    <div class="text-center mt25">
      <svg-icon iconClass="vip" :size="24"/>
      <span class="fb fs16 color-g">恭喜您购买能量包成功!</span>
    </div>
    <div class="fs12 text-center mt15">扫码加入VIP微信群，第一时间响应您的需求！</div>
    <img src="@/assets/vip-code.png" class="vip-code-img" alt="">
  </div>

  <div class="pay-success" v-else>
    <div class="header">
      恭喜您成为会员！获得以下权益
    </div>
    <div>
      <EquityTabs :data="packagesList" :autoTabs="false" isBlack/>
    </div>
    <div class="footer">
      <el-button class="btn-w150 btn-h36 has-radius"
        type="success"
        @click="close">我知道了</el-button>
    </div>
  </div>
</template>

<script>
import mixins from './mixins'
import { mapGetters } from 'vuex'
export default {
  name: 'PaySuccessV2',
  props: {
    isCallPC: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      showType: 'right'
    }
  },
  computed: {
    ...mapGetters(['appCfg'])
  },
  mixins: [mixins],
  created () {
    // this.getPackages()
    if (this.$route.query.type === 'extra') {
      this.showType = 'extra'
      this.$xz('xz_set_window_size', 'XZDesktopOrderVIPSuccess', 398, 340)
      this.$xz('xz_page_load_finished', 'XZDesktopOrderVIPSuccess')
    } else {
      this.getPackagesList()
    }
  },
  methods: {
    onLoadFinish () {
      const h = Math.max(360, this.pkgH + 265 + 24)
      this.$xz('xz_set_window_size', 'XZDesktopOrderVIPSuccess', 656, h)
      this.$xz('xz_page_load_finished', 'XZDesktopOrderVIPSuccess')
    },
    close () {
      if (this.$store.getters.appInfo.appID !== '108') {
        this.$xz('xz_switch_dialog', 'XZDesktopVIPGroup', true, '{}')
      }
      this.$xz('xz_switch_dialog', 'XZDesktopOrderVIPSuccess', false)
    }
  }
}
</script>

<style lang="scss" scoped>
$--color-primary-g: #F8DE9D !default;

.pay-success {
  min-height: 100%;
  padding: 0 25px 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-family: "Microsoft YaHei";
  background: #2D2E35;
  text-align: center;
  border-width: 0;
}
.header {
  width: 356px;
  height: 43px;
  margin: 0 auto 17px;
  text-align: left;
  padding-left: 70px;
  line-height: 38px;
  color: #C3962A;
  font-size: 16px;
  background: url('../../assets/pay-success-v2.png') top left no-repeat;
  background-size: 100% 100%;
  position: relative;
  &::after{
    content: '';
    position: absolute;
    top: 4px;
    left: 32px;
    width: 30px;
    height: 30px;
    background: url('../../assets/svip.png') top left no-repeat;
    background-size: 100% 100%;
  }
}

.footer{
  margin-top: 10px;
  .btn{
    border-radius: 20px;
  }
}

.extra-success{
  background: linear-gradient(180deg, rgba(59, 57, 52, 1) 0%, rgba(52, 53, 59, 1) 100%);
  padding: 12px 16px;
  &::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 80px;
    top: 8px;
    right: 28px;
    background: url('../../assets/pay-success-ico.png') 0 0 / 100% 100%;
    pointer-events: none;
    opacity: .5;
  }
  &::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 10px;
    top: 0;
    left: 50%;
    margin-left: -80px;
    border-radius: 50%;
    background: $--color-primary-g;
    filter: blur(45px);
  }
}
.vip-code-img{
  display: block;
  width: 150px;
  margin: 20px auto 0;
}

.color-g{
  color: $--color-primary-g;
}
</style>
